package com.haoqizhe.kernel.security.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Primary;

/**
 * security权限认证配置
 * @author haoqizhe.li
 * @date 2018/10/12
 **/
@Data
@ConfigurationProperties(prefix = "securityconfig")
@Primary
public class SecuritySetting {
    /**
     * 需认证的地址，多个以逗号分隔
     */
    private String authenticated;
    /**
     * 无需认证的地址，多个以逗号分隔
     */
    private String permitAll;
    /**
     * 成功退出地址
     */
    private String logoutSuccessUrl;
    /**
     * 登出后处理
     */
    private Boolean logoutHandler;
    /**
     * 登出后处理发送MQ
     */
    private String logoutDestination;
    /**
     * 权限认证地址
     */
    private String deniedPage;
    /**
     * 退出登录url
     */
    private String logoutUrl;
    /**
     * 登录时会执行的接口地址
     */
    private String processesUrl;

    public SecuritySetting(){
        this.logoutUrl = "/logout";
        this.logoutSuccessUrl = "/logoutSuccess";
        this.deniedPage = "/deny";
        this.processesUrl = "/login";
        this.logoutHandler = false;
        this.logoutDestination = "SYSTEM.T.LOGOUT";
    }

}
